//
//  GROderDetailFootView.m
//  YC_GRice
//
//  Created by luojinrong11 on 2018/7/23.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GROderDetailFootView.h"

@implementation GROderDetailFootView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(void)awakeFromNib{
    [super awakeFromNib];
    [self.lookeMoreBt.layer setBorderWidth:1];
    [self.lookeMoreBt.layer setBorderColor:HEXCOLOR(0xDDDDDD).CGColor];
}

-(void)setListModel:(GROrderListModel *)listModel{
    _listModel = listModel;
    if (_listModel.lookMore) {
        [self.lookeMoreBt setTitle:@"收起来" forState: UIControlStateNormal];
    }else{
        [self.lookeMoreBt setTitle: @"查看更多" forState: UIControlStateNormal];
    }
    self.lookeMoreBt.hidden = listModel.goods.count >2?NO:YES;
    self.qualityLabel.text = [NSString stringWithFormat:@"共%ld件商品", listModel.totalQuantity];
    self.orderPrice.text = [NSString stringWithFormat:@"%.2lf",listModel.totalPrice];
}
- (IBAction)lookMoreAction:(id)sender {
    if (_delegate && [_delegate respondsToSelector:@selector(showAllGood:)]) {
        [_delegate showAllGood:self.listModel];
    }
}


@end
